@nebutra/ui 0.2.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animate-in-BlvjVh2S.d.ts +250 -0
- package/dist/{canonical-Drca5UMj.d.ts → canonical-DEhT4VfS.d.ts} +83 -369
- package/dist/card-DunB1gKE.d.ts +105 -0
- package/dist/chat/index.d.ts +1 -0
- package/dist/chat/index.js +3 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/components/index.d.ts +90 -126
- package/dist/components/index.js +433 -182
- package/dist/components/index.js.map +1 -1
- package/dist/editorial/index.d.ts +404 -0
- package/dist/editorial/index.js +942 -0
- package/dist/editorial/index.js.map +1 -0
- package/dist/empty-state-bmfHCOuN.d.ts +86 -0
- package/dist/hooks/index.d.ts +18 -1
- package/dist/hooks/index.js +120 -5
- package/dist/hooks/index.js.map +1 -1
- package/dist/icons/index.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/layout/index.d.ts +17 -58
- package/dist/layout/index.js +368 -127
- package/dist/layout/index.js.map +1 -1
- package/dist/layouts/index.d.ts +1 -1
- package/dist/layouts/index.js +93 -28
- package/dist/layouts/index.js.map +1 -1
- package/dist/patterns/index.d.ts +39 -46
- package/dist/patterns/index.js +534 -323
- package/dist/patterns/index.js.map +1 -1
- package/dist/primitives/canonical.d.ts +5 -2
- package/dist/primitives/canonical.js +598 -288
- package/dist/primitives/canonical.js.map +1 -1
- package/dist/primitives/index.d.ts +165 -63
- package/dist/primitives/index.js +1251 -983
- package/dist/primitives/index.js.map +1 -1
- package/dist/tailwind.preset.d.ts +32 -32
- package/dist/tailwind.preset.js +24 -20
- package/dist/tailwind.preset.js.map +1 -1
- package/dist/theme/index.d.ts +1 -110
- package/dist/typography/fonts.css +8 -16
- package/dist/typography/index.d.ts +29 -45
- package/dist/typography/index.js +26 -14
- package/dist/typography/index.js.map +1 -1
- package/dist/utils/auth-surfaces.d.ts +33 -0
- package/dist/utils/auth-surfaces.js +9 -0
- package/dist/utils/auth-surfaces.js.map +1 -0
- package/dist/utils/index.d.ts +20 -16
- package/dist/utils/index.js +99 -20
- package/dist/utils/index.js.map +1 -1
- package/package.json +25 -11
- package/src/typography/fonts.css +8 -16
- package/dist/styles/brand-override.css +0 -61
- package/src/styles/brand-override.css +0 -61
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as framer_motion from 'framer-motion';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
declare const PRESETS: {
|
|
6
|
+
/** 涌现 — materialize from the cloud (default) */
|
|
7
|
+
readonly emerge: {
|
|
8
|
+
readonly initial: {
|
|
9
|
+
readonly opacity: 0;
|
|
10
|
+
readonly transform: "translateY(16px)";
|
|
11
|
+
readonly filter: "blur(6px)";
|
|
12
|
+
};
|
|
13
|
+
readonly animate: {
|
|
14
|
+
readonly opacity: 1;
|
|
15
|
+
readonly transform: "translateY(0px)";
|
|
16
|
+
readonly filter: "blur(0px)";
|
|
17
|
+
};
|
|
18
|
+
readonly exit: {
|
|
19
|
+
readonly opacity: 0;
|
|
20
|
+
readonly transform: "translateY(-8px)";
|
|
21
|
+
readonly filter: "blur(4px)";
|
|
22
|
+
readonly transition: {
|
|
23
|
+
readonly duration: 0.2;
|
|
24
|
+
readonly ease: readonly [0.16, 1, 0.3, 1];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
readonly transition: {
|
|
28
|
+
readonly duration: 0.5;
|
|
29
|
+
readonly ease: readonly [0.16, 1, 0.3, 1];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** 流动 — stream horizontally */
|
|
33
|
+
readonly flow: {
|
|
34
|
+
readonly initial: {
|
|
35
|
+
readonly opacity: 0;
|
|
36
|
+
readonly transform: "translateX(-20px)";
|
|
37
|
+
};
|
|
38
|
+
readonly animate: {
|
|
39
|
+
readonly opacity: 1;
|
|
40
|
+
readonly transform: "translateX(0px)";
|
|
41
|
+
};
|
|
42
|
+
readonly exit: {
|
|
43
|
+
readonly opacity: 0;
|
|
44
|
+
readonly transform: "translateX(20px)";
|
|
45
|
+
readonly transition: {
|
|
46
|
+
readonly duration: 0.2;
|
|
47
|
+
readonly ease: readonly [0.16, 1, 0.3, 1];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly transition: {
|
|
51
|
+
readonly duration: 0.3;
|
|
52
|
+
readonly ease: readonly [0.16, 1, 0.3, 1];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/** Simple fade */
|
|
56
|
+
readonly fade: {
|
|
57
|
+
readonly initial: {
|
|
58
|
+
readonly opacity: 0;
|
|
59
|
+
};
|
|
60
|
+
readonly animate: {
|
|
61
|
+
readonly opacity: 1;
|
|
62
|
+
};
|
|
63
|
+
readonly exit: {
|
|
64
|
+
readonly opacity: 0;
|
|
65
|
+
};
|
|
66
|
+
readonly transition: {
|
|
67
|
+
readonly duration: 0.3;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
/** Fade + rise */
|
|
71
|
+
readonly fadeUp: framer_motion.Variants | undefined;
|
|
72
|
+
/** Scale in */
|
|
73
|
+
readonly scale: framer_motion.Variants | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Keyed content swap — short, symmetric, blur-softened. Rises in, sinks out.
|
|
76
|
+
* Shorter and shallower than `emerge` on purpose: a swap replaces content the
|
|
77
|
+
* reader is already looking at, so it must resolve inside the reveal rail.
|
|
78
|
+
* Pair with `AnimateSwap`.
|
|
79
|
+
*/
|
|
80
|
+
readonly swap: {
|
|
81
|
+
readonly initial: {
|
|
82
|
+
readonly opacity: 0;
|
|
83
|
+
readonly transform: "translateY(10px)";
|
|
84
|
+
readonly filter: "blur(4px)";
|
|
85
|
+
};
|
|
86
|
+
readonly animate: {
|
|
87
|
+
readonly opacity: 1;
|
|
88
|
+
readonly transform: "translateY(0px)";
|
|
89
|
+
readonly filter: "blur(0px)";
|
|
90
|
+
};
|
|
91
|
+
readonly exit: {
|
|
92
|
+
readonly opacity: 0;
|
|
93
|
+
readonly transform: "translateY(-10px)";
|
|
94
|
+
readonly filter: "blur(4px)";
|
|
95
|
+
};
|
|
96
|
+
readonly transition: {
|
|
97
|
+
readonly duration: number;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
/** Off-canvas panel entering from the right edge (drawer, sheet). */
|
|
101
|
+
readonly slideFromRight: {
|
|
102
|
+
readonly initial: {
|
|
103
|
+
readonly transform: "translateX(100%)";
|
|
104
|
+
};
|
|
105
|
+
readonly animate: {
|
|
106
|
+
readonly transform: "translateX(0%)";
|
|
107
|
+
};
|
|
108
|
+
readonly exit: {
|
|
109
|
+
readonly transform: "translateX(100%)";
|
|
110
|
+
};
|
|
111
|
+
readonly transition: {
|
|
112
|
+
readonly type: "spring";
|
|
113
|
+
readonly stiffness: 200;
|
|
114
|
+
readonly damping: 24;
|
|
115
|
+
readonly mass: 1;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
/** Off-canvas panel entering from the left edge. */
|
|
119
|
+
readonly slideFromLeft: {
|
|
120
|
+
readonly initial: {
|
|
121
|
+
readonly transform: "translateX(-100%)";
|
|
122
|
+
};
|
|
123
|
+
readonly animate: {
|
|
124
|
+
readonly transform: "translateX(0%)";
|
|
125
|
+
};
|
|
126
|
+
readonly exit: {
|
|
127
|
+
readonly transform: "translateX(-100%)";
|
|
128
|
+
};
|
|
129
|
+
readonly transition: {
|
|
130
|
+
readonly type: "spring";
|
|
131
|
+
readonly stiffness: 200;
|
|
132
|
+
readonly damping: 24;
|
|
133
|
+
readonly mass: 1;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
/** Off-canvas panel entering from the top edge (banner, command bar). */
|
|
137
|
+
readonly slideFromTop: {
|
|
138
|
+
readonly initial: {
|
|
139
|
+
readonly transform: "translateY(-100%)";
|
|
140
|
+
};
|
|
141
|
+
readonly animate: {
|
|
142
|
+
readonly transform: "translateY(0%)";
|
|
143
|
+
};
|
|
144
|
+
readonly exit: {
|
|
145
|
+
readonly transform: "translateY(-100%)";
|
|
146
|
+
};
|
|
147
|
+
readonly transition: {
|
|
148
|
+
readonly type: "spring";
|
|
149
|
+
readonly stiffness: 200;
|
|
150
|
+
readonly damping: 24;
|
|
151
|
+
readonly mass: 1;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
/** Off-canvas panel entering from the bottom edge (mobile action sheet). */
|
|
155
|
+
readonly slideFromBottom: {
|
|
156
|
+
readonly initial: {
|
|
157
|
+
readonly transform: "translateY(100%)";
|
|
158
|
+
};
|
|
159
|
+
readonly animate: {
|
|
160
|
+
readonly transform: "translateY(0%)";
|
|
161
|
+
};
|
|
162
|
+
readonly exit: {
|
|
163
|
+
readonly transform: "translateY(100%)";
|
|
164
|
+
};
|
|
165
|
+
readonly transition: {
|
|
166
|
+
readonly type: "spring";
|
|
167
|
+
readonly stiffness: 200;
|
|
168
|
+
readonly damping: 24;
|
|
169
|
+
readonly mass: 1;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
type Preset = keyof typeof PRESETS;
|
|
174
|
+
/**
|
|
175
|
+
* DOM attributes forwarded to the underlying element.
|
|
176
|
+
*
|
|
177
|
+
* Without this, anything needing `role`, `aria-*`, `onClick` or `onKeyDown` —
|
|
178
|
+
* every dialog, drawer and tabpanel — has to drop out of `AnimateIn` and
|
|
179
|
+
* hand-roll its own `m.div`, which is how reduced-motion branching and raw
|
|
180
|
+
* duration numbers keep reappearing at call sites.
|
|
181
|
+
*
|
|
182
|
+
* The four drag/animation handlers are omitted because framer-motion redefines
|
|
183
|
+
* them with incompatible signatures. `style` is omitted because framer's
|
|
184
|
+
* `MotionStyle` rejects `undefined` under `exactOptionalPropertyTypes`, and an
|
|
185
|
+
* animated element's static styling belongs in `className` anyway.
|
|
186
|
+
*/
|
|
187
|
+
type ForwardedDivProps = Omit<React.ComponentPropsWithoutRef<"div">, "children" | "className" | "style" | "onAnimationStart" | "onDrag" | "onDragStart" | "onDragEnd">;
|
|
188
|
+
interface AnimateInProps extends ForwardedDivProps {
|
|
189
|
+
/** Optional: a purely decorative animated surface (a backdrop) has no content. */
|
|
190
|
+
children?: React.ReactNode;
|
|
191
|
+
preset?: Preset;
|
|
192
|
+
delay?: number;
|
|
193
|
+
duration?: number;
|
|
194
|
+
/** Trigger when enters viewport instead of immediately */
|
|
195
|
+
inView?: boolean;
|
|
196
|
+
className?: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* AnimateIn — wraps any content in a branded entrance animation.
|
|
200
|
+
*
|
|
201
|
+
* Respects `prefers-reduced-motion` by fading only (no translate/blur).
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
* <AnimateIn preset="emerge" delay={0.1}>
|
|
205
|
+
* <Card>...</Card>
|
|
206
|
+
* </AnimateIn>
|
|
207
|
+
*/
|
|
208
|
+
declare function AnimateIn(props: AnimateInProps): react_jsx_runtime.JSX.Element;
|
|
209
|
+
interface AnimateSwapProps extends AnimateInProps {
|
|
210
|
+
/**
|
|
211
|
+
* Identity of the content currently rendered. When it changes, the outgoing
|
|
212
|
+
* content plays its exit and is fully unmounted before the incoming content
|
|
213
|
+
* enters (`AnimatePresence mode="wait"`).
|
|
214
|
+
*/
|
|
215
|
+
swapKey: React.Key;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* AnimateSwap — swap one piece of content for another, one at a time.
|
|
219
|
+
*
|
|
220
|
+
* `AnimateIn` can only animate an entrance: it has no `AnimatePresence`, so its
|
|
221
|
+
* `exit` never plays and a keyed replacement cross-fades on top of itself. Any
|
|
222
|
+
* tab panel, step body or filtered result set therefore had to hand-roll
|
|
223
|
+
* `AnimatePresence mode="wait"` plus a raw `m.div`. This is that pattern, once.
|
|
224
|
+
*
|
|
225
|
+
* Reduced motion is inherited from `AnimateIn`: opacity only, no travel, no blur.
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* <AnimateSwap swapKey={activeTab} preset="swap" role="tabpanel">
|
|
229
|
+
* {panelFor(activeTab)}
|
|
230
|
+
* </AnimateSwap>
|
|
231
|
+
*/
|
|
232
|
+
declare function AnimateSwap(props: AnimateSwapProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
interface AnimateInGroupProps {
|
|
234
|
+
children: React.ReactNode;
|
|
235
|
+
stagger?: "fast" | "normal" | "slow";
|
|
236
|
+
preset?: Preset;
|
|
237
|
+
inView?: boolean;
|
|
238
|
+
className?: string;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* AnimateInGroup — staggered container. Each direct child animates in sequence.
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* <AnimateInGroup stagger="normal" inView>
|
|
245
|
+
* {items.map(item => <AnimateIn key={item.id} preset="fadeUp">{item}</AnimateIn>)}
|
|
246
|
+
* </AnimateInGroup>
|
|
247
|
+
*/
|
|
248
|
+
declare function AnimateInGroup(props: AnimateInGroupProps): react_jsx_runtime.JSX.Element;
|
|
249
|
+
|
|
250
|
+
export { AnimateIn as A, AnimateInGroup as a, type AnimateInGroupProps as b, type AnimateInProps as c, AnimateSwap as d, type AnimateSwapProps as e };
|